<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-on参数传递</title>
</head>
<body>
    <div id="app">
        <!-- 阻止事件冒泡(.stop) -->
        <div @click="clickDiv">
            aaaaassss
            <button @click.stop="btn">按钮</button>
        </div>

        <!-- 阻止默认事件(.prevent) -->
        <form action="baidu">
            <input type="submit" value="提交" @click.prevent="submitClick">
        </form>

        <!-- 监听键盘的按键(enter:回车键) -->
        <input @keyup.enter="press" type="text" />

        <!-- once:只触发一次 -->
        <button @click.once="ddd">dddd</button>
    </div>

    <script src="../vue/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                count:0
            },
            methods: {
                clickDiv(){
                    console.log('div');
                },
                btn(){
                    console.log('btn');
                },
                submitClick(){
                    console.log('1111');
                },
                press(){
                    console.log('抬起');
                },
                ddd(){
                    console.log('once');
                }
            },
        });
    </script>
</body>
</html>